﻿using BusinessRepository;
using System;
using System.Collections.Generic;
using System.Data;
using System.Text;
using System.Threading.Tasks;
using BusinessRule.Organization;
using BusinessEntity;
using learun.util;

namespace BusinessRule
{
    public class XMListRule
    {
        public async static Task<List<JavaApi.DataItemDIC>> Getdics(string strbuyModule, (string, string) apiinfo)
        {
            List<JavaApi.DataItemDIC> list = await JavaApi.GetDicJavaAPI(strbuyModule, apiinfo);
            return list;
        }

        public async static Task<bool> sfgmmk((string, string) apiinfo)
        {
            string strbuyModule = ConfigHelper.GetAppSettings("ServerOp:buyModule");
            string buyxmgl = ConfigHelper.GetAppSettings("ServerOp:buyxmgl");
            string sfpd = ConfigHelper.GetAppSettings("ServerOp:sfpd");
            if (sfpd == "1")
            {
                List<JavaApi.DataItemDIC> list = await JavaApi.GetDicJavaAPI(strbuyModule, apiinfo);
                bool exists = false;
                for (int i = 0; i < list.Count; i++)
                {
                    if (list[i].value.ToString() == "项目管理")//buyxmgl
                    {
                        exists = true;
                        break;
                    }
                }
                return exists;
            }
            else
            {
                return true;
            }

            //return exists;
        }
    }
}
